/**
 * Created by zheng on 2019/1/3.
 */

const debounce = function (func, count) {
	let interval = null
	let debounceFunc = function () {
		let me = this
		let arg = arguments
		if (interval != null)
			clearInterval(interval)
		interval = setInterval(() => {
			func.apply(me, arg)
			clearInterval(interval)
		}, count)
	}
	return debounceFunc
}

export default debounce